package cn.gov.cus.rmftquartz.common;

import com.google.gson.GsonBuilder;

/**
 * @author wxming.
 * @date 2018/1/12.
 */
public class Result<T> {
    private boolean success = true;
    private T data;
    private String msg ="";

    public Result() {
    }

    public Result(T data) {
        this.data = data;
    }

    public Result(boolean success, String msg) {
        this.success = success;
        this.msg = msg;
    }

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    @Override
    public String toString() {
        return "{\"success\":" + this.success + ", \"data\":" + this.data + ", \"msg\":\"" + this.msg + "\"}";
    }
   /* @Override
    public String toString() {
        return "Result{" +
                "success=" + this.success +
                ", data=" + this.data +
                ", msg='" + this.msg + '\'' +
                '}';
    }*/
}
